home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs19.d81
/
simman.arc
/
MANDEL1.TXT
< prev
next >
Wrap
Text File
|
2009-10-10
|
14KB
|
331 lines
BB
B INTRODUCTION Mandelbrot set system
B by John M. Albergo
B
B The Mandelbrot Set is a mathematical construct of infinite
B complexity. Its fascinating images can be viewed by the use of a
B computer with graphics capabilities. The programs in this kit function
B together to make the C64 a useful tool in the exploration of this
B infinite mathematical territory. If you are unfamiliar with the
B concept of the Mandelbrot Set, it may be helpful to do some reading on
B the subject. The book, CHAOS: MAKING A NEW SCIENCE, by James Gleick is
B widely available, straightforward and a good place to start.
B The Mandelbrot Set is a collection of numbers, or points on a
B plane, that share a common property. A mathematical operation is
B performed on each point, repeatedly. After a certain number of
B repetitions have occured, and the number has not run off towards
B infinity, it is considered a part of the set. In actuality a point is
B truly a member of the set if it can undergo an INFINITE number of
B repetitions without growing infinitely large. Since computing time is
B limited, we must make our decisions a bit prematurely. The points
B outside the set run off toward infinity at different rates. The varied
B properties of these numbers contribute to the visual topography of the
B images.
B
B
B COMPUTING TIME
B
B The length of time required to generate images of the set depends
B on several factors. Some images will compute in an hour or two. Some
B can take several DAYS. It depends upon how deeply you are magnifying
B the set, which part of the set you are looking at and how much
B resolution you want. The programs are compiled and optimized for
B speed. But the infinite nature of the set means that eventually even a
B supercomputer will be overtaxed. The images obtainable with this kit
B compare favorably to some produced by much more powerful machines.
B The calculating program can be stopped and restarted to allow you
B access to your computer whenever you want.
B
B
B REQUIREMENTS
B
B To use this kit you need:
B
B C64 with 2 drives
B SIMON'S BASIC (a commercial software pkg.)
B Patience.
B
B
B THE KIT
B
B The kit consists of the following:
B
B (compiled programs)
B
B MANDELCRUNCH - performs the number crunching that is at the heart
B of any mandelbrot set program.
B
B MANDELPAINT - lets you develop and adjust the graphics images to
B your taste.
B
B MAGNIBROT - allows you to "zoom" in on selected regions of the set
B by adjusting the magnification "window".
B
B
B (basic programs)
B
B AUTO-SEQ - displays multiple images in sequence to help visualize
B the magnification process.
B
B COLOURS - lets you adjust the colours in the images. Also
B "rotates" the colours as a "special effect".
B
B
B
B THE FILES
B
B The disk in drive 9 holds the files pertaining to the raw data
B generated by MANDELCRUNCH. Drive 8 should hold all
B your program files. Drive 8 will also
B hold the "picture" files that are refined from the raw data.
B
B
B RAW DATA FILES
B
B MANDELCRUNCH deals with 3 files, which are kept on drive 9. The
B structure of these filenames is:
B
B (root).(ext)
B
B The root name is supplied by you.
B The extensions are program-generated and will be
B
B dat - data file
B prm - parameter file
B dst - distribution file
B
B The data file is large, since it consists of two bytes for each of
B the 32000 points in the mandelbrot grid. Therefore, only 2 mandelbrot
B runs will fit on a data disk. Each run also uses a parameter file to
B keep track of restarts. When the program is complete, a distribution
B file is generated which is used by MANDELPAINT to fine-tune the
B graphics images.
B
B
B PICTURE FILES
B
B The fine-tuned images generated by mandelpaint are saved as
B picture files of 32 blocks each. The format for picture files is:
B
B (root).(ext).(mandelbrot indicator)
B
B The root name will match the root name on the MANDELCRUNCH files.
B The extension may be program generated or user generated. More on that
B later. The mandelbrot indicator is simply a y or an n to indicate of
B any of the points fall within the mandelbrot set.
B Magni-Brot also generates picture files. For these files the
B format is free-form.
B
B
B
B
B
B RUNNING THE SYSTEM
B
B
B Your kit comes with the program files, the document files, some
B sample picture files, and a sample parameter file.
B Put all the program files and the picture file on drive 8. Put
B the parameter file on drive 9. All of the program files use SIMON'S
B BASIC except for MANDELCRUNCH.
B Try running the COLOURS program. Load SIMON'S BASIC into the
B system, then load and run COLOURS. When prompted for a filename, enter
B the complete name of one of the picture files. Try "onw3>onw4.y".
B Once the picture is displayed, vary the colors with the "1" "2" "3"
B keys. Rotate the colors by pressing "r". While the colors are
B rotating, press "+" or "-" keys to control the rotation speed. To stop
B rotation, press "r" again.
B
B Load and run AUTO-SEQ. Each press of a key will load successively
B higher magnifications of a section of the set. These are all picture
B files created by MANDELPAINT and MAGNIBROT. The use of a fast-load
B cartridge may speed up the loading of images, as these are stored as
B program files.
B
B
B CREATING YOUR OWN IMAGES
B
B As mentioned earlier, MANDELCRUNCH is the heart of the system.
B Each image depends upon the millions of calculations performed by
B MANDELCRUNCH. MANDELCRUNCH generates the data for an area of the
B mandelbrot set that you specify. The area may be large enough to
B contain the entire set, or microscopically small.
B MANDELCRUNCH needs to know the area to be viewed. It needs to
B know the maximum number of "iterations", or how many times each point
B will be calculated before it is accepted as a part of the set. It also
B needs to keep track of where it is in the run, so that it may be
B interrrupted and restarted. The parameter file contains these three
B pieces of information.
B Parameter files are created 2 different ways. The easiest way to
B create parameters is to use MAGNIBROT. You may also create the
B parameters manually when you first run MANDELCRUNCH.
B
B Load and run MANDELCRUNCH. SIMON'S BASIC is not needed for this
B program. It will ask you for the root name of the area to be
B calculated. If you have used MAGNIBROT, the program will load the
B parameters from drive 9 and will begin crunching.
B
B If no parameter file exists for the root name, you will be given
B the option of creating one. To create the parameters, you must enter
B rl,rh,il,ih and the iteration limit. The variables correspond to the
B low and high limits of the real and imaginary numbers in the area of
B the complex plane to be examined. This will make sense to you if you
B have done some reading on the subject of the mandelbrot set. Once you
B enter the information, the program will begin the run. NOTE: when
B entering the limits for the real and imaginary numbers, make sure that
B the range of the imaginary numbers equals 80% of the range of the
B reals. That is, make sure that (ih-il) = .8(rh-rl).
B This is needed to compensate for the nature of C64 graphics. If you
B use MAGNIBROT on a previous image, the proper ratio will be
B automatically generated.
B
B See "hints and tips" for information on how to choose your
B parameters.
B
B MANDELCRUNCH will run. And run and run. It may keep running for
B quite a while. You might start to wonder if it is running at all. The
B screen is blanked out while the program runs. This is a trick to gain
B some speed. Since the processor doesn't have to bother with the
B display, it has more time to crunch. There are 2 ways to get an idea
B of how far along the program is. First, the screen won't stay solid
B black. It will change colours during the run. The c64 graphics are
B 160 collumns and 200 rows. The screen will change color every ten
B collumns. If you are familiar with the c64 color code progression, you
B will have a good idea where the program is at. If you don't, don't
B worry. The program is interruptible, and when you interrupt it, it
B will tell you exactly where it is at.
B To interrupt MANDELCRUNCH, hit the left arrow key at the top left
B of the keyboard. This will halt the program, the screen will come to
B life, and you will see how far along the program is. If you are
B computing an image with a high iteration limit, there may be a moment
B before the program interrupts, as the program finishes the computations
B for the particular point it is examining.
B While the program is paused, you have the option of saving it or
B resuming. To save press "s" to resume press "r". Once the parameters
B have been saved, you can turn off the computer. To restart
B MANDELCRUNCH, simply run it and tell it which parameter file to use.
B It will load the parameters and fast-forward to where it left off.
B Eventually, MANDELCRUNCH will end. The disk will be busy near the
B end, as the distribution file is created. You are now ready to run
B MANDELPAINT.
B
B
B
B MANDELPAINT.
B
B The graphics images produced by MANDELPAINT are the result of
B mating the MANDELCRUNCH data to the c64 graphics, and to your visual
B tastes.
B The points that withstand the maximum iterations are in the set,
B and are colored black. Simple enough. But what about the rest of the
B points? This is where much of the beauty is.
B As the points get closer to the set, they are pulled to infinity
B more and more slowly. The graphics images show the varied topography
B of these points. Pinwheels, starfish, curlicues and other shapes
B become apparent.
B Unfortunately, the c64 gives us only 4 colors to work with.
B MANDELPAINT helps to make the most of them.
B
B Load and run MANDELPAINT (you must be using SIMON'S BASIC). The
B data disk must be in drive 9. Supply the root name, and the program
B will read in the distribution file. The distribution file allows you
B to see how the data points are distributed within the iteration range.
B You can examine the distribution either graphically, or as a printout.
B The distribution graph will show the frequency of each iteration level
B compared to the highest count. For example, assume you specified a
B maximum iteration of 100 in your parameter file. Look at the graph.
B The graph is marked at the bottom of the screen. The big marks are
B 100's , the little ones are 10's. Assume the highest point of the
B graph is at 20. This would mean that more points ran to infinity after
B 20 iterations than any other value. The rest of the graph is then
B scaled in proportion to the number of points at 20. Some graphs will
B have a pronounced peak, with all other values dropping off rapidly.
B Others may have many points near the peak. The graph can help you pick
B manual cutoff points for colorizing the picture. The graph can also
B help you pick iteration levels for your next magnification. If you
B used more than 300 iterations, each successive key press will display
B the graph for another 300 iterations. After the full range has been
B displayed, you will be prompted by the menu.
B
B After viewing the graph, you can exit back to the main program and
B choose your colorization method, either Auto or Manual. Both methods
B generate cutoff points that define how the set will be displayed. The
B cutoff points are like lines on a topographic map. The faster the
B terrain changes, the closer together the lines are on a topographic
B map. The same applies to the display. The faster the iteration levels
B change, the narrower the color bands will be. If the cutoff points are
B too close together, it will be difficult to see patterns. the display
B may look like random dots. If the cutoff points are too large,
B interesting details may be lost.
B The Auto method saves a lot of time going over distribution lists
B and charts, and allows you to vary the cutoff points easily. The
B display consists of 32000 points, or pixels. You tell the program the
B minimum number of pixels to be devoted to any rage of iteration values.
B For example, specifying a number of 4000 would ensure a maximum of 8
B color zones on the display. A value of 500 would mean 64 color zones.
B The best value is a matter of taste. Experiment.